package com.mytoutou.playermanager.player_manager.player_messages;




import com.mytoutou.playermanager.player_manager.manager.VideoPlayerManagerCallback;
import com.mytoutou.playermanager.player_manager.ui.VideoPlayerView;
import ohos.media.common.Source;

/**
 * This PlayerMessage calls {@link ohos.media.player.Player#setSource(Source)} (Source)} on the instance that is used inside {@link VideoPlayerView}
 */
public class SetUrlDataSourceMessage extends SetDataSourceMessage{

    private final String mVideoUrl;

    public SetUrlDataSourceMessage(VideoPlayerView videoPlayerView, String videoUrl, VideoPlayerManagerCallback callback) {
        super(videoPlayerView, callback);
        mVideoUrl = videoUrl;
    }

    @Override
    protected void performAction(VideoPlayerView currentPlayer) {
        currentPlayer.setDataSource(mVideoUrl);
    }
}
